package thread;

public class Demo18 {
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(() -> {
            while (true) {
                System.out.println("hello");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });
        t.start();

        //死等版本的join
        // t.join();

        //带有超时时间的等
        t.join(3600*1000);
    }
}
//WAITING           死等进入的阻塞
//TIMED_WAITING     带有超时时间的等
//BLOCKED           进行锁竞争的时候产生的阻塞